package com.beck;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;

@SpringBootApplication
//@PropertySource("classpath:app.properties")
@Slf4j
public class HelloWorldApplication extends SpringBootServletInitializer {
    public static void main(String[] args) throws FileNotFoundException {
        File path = new File(ResourceUtils.getURL("classpath:").getPath());
        System.out.println("========="+path.getAbsolutePath());
        System.out.println(Arrays.toString(args));
        SpringApplication.run(HelloWorldApplication.class);
    }

    @Override
    public SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(HelloWorldApplication.class);
    }

    //@Value("${myage}")
    private int age;
}
